Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

feat: Regenerate libraries with protobuf-4.x - #4256

Closed
diegomarquezp wants to merge 5 commits into
mainfrom
feature/protobuf-4.x-generation
Closed

feat: Regenerate libraries with protobuf-4.x#4256
diegomarquezp wants to merge 5 commits into
mainfrom
feature/protobuf-4.x-generation

Conversation

@diegomarquezp

Copy link
Copy Markdown
Contributor

This PR regenerates the client libraries using protobuf code generator 4.x

@product-auto-label product-auto-label Bot added size: xl Pull request size is extra large. api: spanner Issues related to the googleapis/java-spanner API. labels Dec 8, 2025
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @diegomarquezp, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request undertakes a major regeneration of client libraries to incorporate protobuf-4.x, which is a foundational update impacting numerous API definitions and build processes. It also integrates new API surfaces for Google Actions SDK v2 and Google Ad Manager v1, significantly enhancing the project's scope. Concurrently, the PR refines the build and release pipeline through updated Bazel configurations, new scripts for Bazel Central Registry integration, and improved Cloud Build automation, ensuring a more robust and streamlined development workflow.

Highlights

  • Protobuf Version Update: The client libraries have been regenerated to align with protobuf-4.x, ensuring compatibility with the latest Protocol Buffers features and improvements.
  • Native Image Support for Spanner: Reflection configuration files for Google Cloud Spanner libraries have been updated to include new protobuf descriptor classes, enhancing native image compilation support.
  • New API Definitions: This PR introduces comprehensive new API definitions for Google Actions SDK v2 and Google Ad Manager v1, expanding the available services and functionalities.
  • Build and Release Infrastructure Overhaul: Significant updates to the project's build and release processes have been implemented, including new Bazel configurations, scripts for Bazel Central Registry (BCR) publishing, and Cloud Build automation.
  • Documentation and Project Setup: New documentation files such as README.md, CONTRIBUTING.md, LICENSE, and SECURITY.md have been added or updated, alongside various configuration files for development and CI/CD.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request regenerates client libraries using protobuf 4.x and introduces a substantial amount of new tooling for Bazel, GitHub Actions, and publishing to the Bazel Central Registry. My review focused on the new scripts and configuration files. I've identified a few areas for improvement in the publish-to-bcr.sh script to enhance its robustness and clarity, such as handling file writes more safely and clarifying an outdated comment. I also noted a brittle dependency in the test script publish-to-bcr_test.sh that could be improved for long-term maintainability. Additionally, there's an unused --dry_run parameter that should be addressed.

function append_version_to_metadata() {
local version="$1"
local metadata_file="$2"
cat <<< $(jq ".versions += [\"${version}\"]" "${metadata_file}") > "${metadata_file}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The use of > for in-place editing can be risky. If the jq command fails for any reason, ${metadata_file} might be truncated and left empty. A safer approach is to write the output to a temporary file first, and then replace the original file upon success.

Suggested change
cat <<< $(jq ".versions += [\"${version}\"]" "${metadata_file}") > "${metadata_file}"
jq ".versions += [\"${version}\"]" "${metadata_file}" > "${metadata_file}.tmp" && mv "${metadata_file}.tmp" "${metadata_file}"

Comment on lines +243 to +246
-d|--dry_run)
dry_run="$2"
shift
;;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The --dry_run option is parsed but the dry_run variable is never used in the script. This could be misleading for users expecting a dry-run functionality. If this feature is intended for future use, it might be better to add a comment indicating it's not yet implemented or remove the option until it is. If it's a remnant of a removed feature, it should be deleted.

fi

if [[ -z "${templates_ref}" ]]; then
echo "assuming templates_ref to be the HEAD of master"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment mentions master, but the command uses HEAD. It would be clearer to update the comment to reflect that HEAD is being used, which typically points to the default branch (e.g., main).

Suggested change
echo "assuming templates_ref to be the HEAD of master"
echo "assuming templates_ref to be the HEAD of the default branch"

Comment on lines +59 to +60
functions_to_load=$(sed '/^# parse input parameters/,$d' "$(dirname "$0")/publish-to-bcr.sh")
eval "$functions_to_load"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Sourcing functions from the main script using sed based on a comment is brittle. If the comment # parse input parameters is changed or removed in publish-to-bcr.sh, this test script will break. Consider refactoring the functions into a separate library file that can be sourced by both the main script and the test script for better maintainability.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spanner Issues related to the googleapis/java-spanner API. size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant